<!-- FIND OLD CAR -->

<?php $this->lang->load('front/box_find_old'); ?>

<?php
$car_make = $this->pickup_model->get_car_makes();
$state = $this->location_model->get_states(config_item('default_country_code'));
$min_year = $this->pickup_model->populate_year('P', 15, date('Y', now()));
$max_year = $this->pickup_model->populate_year('P', 15, date('Y', now()));
$car_transmission = $this->pickup_model->get_pickup(2);
$car_driven = $this->pickup_model->get_pickup(13);
?>
<div class="grid_6">
    <div class="tabs tabs_var1">
        <ul class="nav">
            <li class="selected"><a style="width: 200px" href="#car_tab"><?=lang('Find Used Car')?></a></li>
        </ul>
        <div class="clear"></div>
        <div class="tabs_1">
            <div id="car_tab" class="tab-content">
                <div class="inner" style="height:292px; overflow: hidden;">
                    <form id="form-main" method="post" action="<?= base_url();?>search/used_car">
                        <h2> <?=lang('Looking for a Used car')?></h2>
                        <div style="margin-bottom: 10px">
                            <?=lang('Search thousand of used car')?> 
                        </div>    
                        <div class="rowElem">
                            <div class="fleft">
                                <label><strong><?=lang('Make')?></strong></label>
                                <select name="make" onChange="getCarModel(this.value,'<?= base_url(); ?>','used_car_modeldiv');">
                                    <option value="0" selected><?=lang('Make')?></option>
                                    <?php foreach ($car_make as $car_make): ?> 
                                        <option value="<?= $car_make->id; ?>"><?= $car_make->make; ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                            <div class="fleft marg_left">
                                <label><strong><?=lang('Model');?></strong></label>
                                <div id="used_car_modeldiv">
                                    <select name="car_model" onChange="getCarVersion(this.value,'<?= base_url(); ?>');">>
                                        <option value="" selected="selected"><?=lang('Model');?></option>
                                        <option value="" disabled="disabled">----------------</option>
                                    </select>  
                                </div>
                            </div>                                    
                            <div class="clear"></div>        
                        </div>
                        <div class="rowElem">
                            <div class="fleft">
                                <label><strong><?=lang('Region');?></strong></label>
                                <select name="state" onChange="getCity(this.value,'<?= base_url(); ?>','used_car_get_city');">
                                    <option value="0" selected="selected"><?=lang('Region');?></option>
                                    <option value="" disabled="disabled"> -----------------</option>
                                    <?php foreach ($state as $state): ?> 
                                        <option value="<?= $state->id; ?>"><?= $state->state; ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                            <div class="fleft marg_left">
                                <label><strong><?=lang('City');?></strong></label>
                                <div id="used_car_get_city">
                                    <select name="city">
                                        <option value="" selected="selected"><?=lang('City');?></option>
                                        <option value="" disabled="disabled">----------------</option>
                                    </select>  
                                </div>
                            </div>
                            <div class="clear"></div>                                            
                        </div>
                        <div class="rowElem">
                            <div class="fleft">
                                <div class="mini_col fleft">
                                    <label><strong><?=lang('Min Year');?>:</strong></label>
                                    <select name="min_year" style="width: 90px;">
                                        <option value=""><?=lang('Min Year');?></option>
                                        <?php foreach ($min_year as $min_year): ?> 
                                            <option value="<?= $min_year; ?>"><?= $min_year; ?></option>
                                        <?php endforeach; ?>

                                    </select>
                                </div>
                                <div class="mini_col fleft marg_right_zero">
                                    <label><strong><?=lang('Max Year');?>:</strong></label>
                                    <select name="max_year" style="width: 90px;">
                                        <option value=""><?=lang('Max Year');?></option>
                                        <?php foreach ($max_year as $max_year): ?> 
                                            <option value="<?= $max_year; ?>"><?= $max_year; ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                </div>
                                <div class="clear"></div>
                            </div>
                            <div class="fleft marg_left" >
                                <label><strong> Budget (Maximum):</strong></label>
                                <input name="budget" type="text"/>
                                <div class="clear"></div>
                            </div>
                            <div class="clear"></div>                                           
                        </div>
                        <div class="rowElem">
                            <div class="fleft">
                                <label><strong><?=lang('Car Driven');?>:</strong></label>
                                <select name="driven">
                                    <option value="0" selected><?=lang('Car Driven');?></option>
                                    <?php foreach ($car_driven as $car_driven): ?> 
                                        <option value="<?= $car_driven->slno; ?>"><?= $car_driven->description; ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                            <div class="fleft marg_left">
                                <a onClick="document.getElementById('form-main').submit()" class="inline-block button_search color_1 bold"><span class="inline-block"><?=lang('Search Car')?> !</span></a>
                            </div>
                            <div class="clear"></div>
                            
                            
                        </div>
                    </form>
                </div>
            </div>


        </div>
    </div>
</div> <!-- GRID_6 END HERE -->